﻿using System.ComponentModel;
using Achievements;

namespace AchievementSample.ViewModels
{
    public class ItemViewModel : ViewModelBase
    {
        private const string AchievementPropertyString = "Achievement";

        private Achievement _achievement;

        public ItemViewModel()
        {
            if (DesignerProperties.IsInDesignTool)
            {
                Achievement = AppAchievements.Instance.AllAchievements[0];
            }
        }

        public Achievement Achievement
        {
            get { return _achievement; }
            set
            {
                if (_achievement != value)
                {
                    _achievement = value;
                    RaisePropertyChanged(AchievementPropertyString);
                }
            }
        }
    }
}